<?php
/**
 * Created by Shijie Liu. 2017/6/20
 * 登录时加载，更新js框中的购物车信息
 */
include("DB_util.php");

    getCart_forBox();

    function getCart_forBox(){

        $use_id = $_COOKIE["user_login"];
        if (isset($use_id)){
            $sql_b = "SELECT book.book_id,book.book_name,book.book_price from book,book_cart,user 
    where book_cart.book_id = book.book_id AND user.user_id = book_cart.user_id AND user.user_id= $use_id;";
            $db_b = new DB_util();
            $result_b = $db_b->queryDB($sql_b);
        } else{
            $result_b = null;
        }
        return $result_b;
    }
